package models

import (
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

type User struct{
	Id int
	Name string
	Pwd string
}


func init(){
	orm.Debug = true;//开启调试模式
	aliasName := "default"
	driverName := "mysql"
	dataSource := "root:123456@tcp(127.0.0.1:3306)/test?charset=utf8"
	orm.RegisterDataBase(aliasName, driverName, dataSource)
	//注册model
	orm.RegisterModel(new(User))
	orm.RunSyncdb("default",false,true)
}